package com.yudean.esb.dao.esb;

import com.yudean.esb.domain.esb.EsbServiceSubMapper;
import com.yudean.esb.mapper.esb.EsbServiceSubMapMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
@Repository
public class EsbServiceSubMapperDao {
    public static final Logger logger = LoggerFactory.getLogger(EsbServiceSubMapperDao.class);
    @Resource
    private EsbServiceSubMapMapper esbServiceSubMapMapper;

    public List<EsbServiceSubMapper> getAll() {
        List<EsbServiceSubMapper> list = esbServiceSubMapMapper.select();
        if (list == null || list.size() < 1)
            return null;
        return list;
    }


    public List<EsbServiceSubMapper> getByRelationID(String ID) {
        if (ID == null) {
            return null;
        } else {
            return esbServiceSubMapMapper.selectByRelationID(ID);
        }
    }

    public void insert(EsbServiceSubMapper mapper) {
        esbServiceSubMapMapper.insert(mapper);
    }

    public void delete(EsbServiceSubMapper mapper) {
        esbServiceSubMapMapper.delete(mapper);
    }

    public void insertBatch(List<EsbServiceSubMapper> mapperList) {
        if (mapperList == null || mapperList.size() < 1)
            return;
        esbServiceSubMapMapper.insertBatch(mapperList);
    }

}
